﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using yq.ControllerBase;
using System.Web.Mvc;
using yq.SyncCaChe;

namespace yq.Controller.Home
{
    public class TaskController : BaseController
    {
        /// <summary>
        /// 执行调度任务
        /// </summary>
        /// <returns></returns>
        [NoPurviewFilter()]
        public ActionResult Index()
        {
            //执行任务
            yq.GetService.Create<yq.IService.ITask>().ForRun(WebConfig.RunTaskNum);

            return this.Content("y");
        }

        /// <summary>
        /// 更新缓存
        /// </summary>
        /// <returns></returns>
        [NoPurviewFilter()]
        public ActionResult MonitorDB()
        {

            //更新服务序号，每个调用请不要重复
            new MonitorDB().OpenOnly("WEB_Application_Start_XXXWW");

            return this.Content("y");
        }
    }
}
